# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-validators
pkgver=0.20.1
pkgrel=1
pkgdesc="Python Data Validation for Humans"
url="https://github.com/kvesteri/validators"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest')
source=("https://github.com/kvesteri/validators/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('b1c204afa57d6d0e31bdefb8b0306c89aa239238ecf2d703cabd10b0630663dc86b1ccc61f9aeac36d6aec7ec37e0ee17defd24ddde63a7eb77885cc6d85389d')

build() {
  cd validators-$pkgver
  python -m build -nw
}

check() {
  cd validators-$pkgver
  python -m pytest
}

package() {
  cd validators-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
